#pragma once
#include <vector>
#include <iostream>

#include "Observer.h"
class Observer;
class Subject
{
public:	
	void add(Observer* observer) {
		collect_.push_back(observer);
	}
	void notify(int val){
		for (Observer* obs : collect_) {
			obs->update(this, val);
		}
	}
	void show(int val) {
		std::cout << "val: " << val << std::endl;
	}
private:
	std::vector<Observer*> collect_;
};

